home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / programming / amiga / muibuilder / mb / developer / c / sources_gencodec / hook_utility.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-29  |  515 b   |  18 lines

  1. #include "Hook_Utility.h"
  2.  
  3. static APTR __saveds __asm Function_Hook(register __a0 struct Hook *hook,
  4.                                   register __a2 APTR        object,
  5.                                   register __a1 APTR        message)
  6. {
  7.     return(((proto_c_function)hook->h_SubEntry)(hook,object,message));
  8. }
  9.  
  10. void InstallHook(struct Hook *hook, proto_c_function c_function, APTR Data)
  11. {
  12.     struct MinNode null_node = {NULL,NULL};
  13.  
  14.     hook->h_MinNode = null_node;
  15.     hook->h_Entry = (ULONG (*)()) Function_Hook;
  16.     hook->h_SubEntry = (ULONG (*)())c_function;
  17.     hook->h_Data = Data;
  18. }